<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="lib/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="lib/layui/css/admin.css"  media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">查看</a>
    <!--    <a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="receive">收货</a>-->
    <!--    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->
</script>
<fieldset class="layui-elem-field layui-field-title">
    <legend>收货管理</legend>
</fieldset>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-card-body">
                    <table class="layui-hide" id="test" lay-filter="test"></table>
                </div>
            </div>
        </div>
    </div>
</div>


<!--<button type="button" class="layui-btn"  onclick="insertDelivery()">批量收货</button>-->
<!--<table class="layui-hide" id="test1" lay-filter="test"></table>-->



<table>

</table>
<script src="lib/jquery-1.12.4.js"></script>
<script src="lib/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->


<script>
    layui.use('table', function() {
        var table = layui.table;

        var whEntryId = parent.whEntryId;
        console.log(whEntryId);
        //监听行工具事件
        table.render({
            elem: '#test'
            , url: 'pk/warehouseEntry/listWhEntryDByWhEId'
            , where: {
                whEntryId: whEntryId
            }
            , parseData: function (res) { //res 即为原始返回的数据
                return {
                    "code": 0, //解析接口状态
                    "msg": "", //解析提示文本
                    "count": 1, //解析数据长度
                    "data": res.obj //解析数据列表
                };
            }
            , cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            , cols: [[
                {type: 'checkbox'}
                , {field: 'goodsName', title: '入库商品名称', sort: true}
                , {field: 'warehouseEntryQuantity', title: '需入库数量', sort: true}
                // ,{field:'supplierName', title: '供应商名称', sort: true}
                // ,{field:'statusName', title: '状态', sort: true}
                // ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
            ]]
        });
    });

        //监听行工具事件


</script>
</body>
</html>